class Task < ActiveRecord::Base

	belongs_to :user
	belongs_to :patient
	
	class << self
	
		def tasks_by_hour(user_id,startdate)
			enddate = startdate+7
			Task.find_all_by_user_id(  user_id, :conditions => { :date => ( startdate.to_datetime .. enddate.to_datetime ) } )
		end
		
	end
end
